package com.tianhui.consignortwofei.pattern.freightCalculation;

import com.tianhui.consignortwofei.mvp.model.enty.OrderInfo;

/**
 * @author fgs
 * @date 2020/9/23
 * @description
 **/
public class CalculationController {
    private IFreightCalculationNew iFreightCalculation;

    private CalculationController() {
        iFreightCalculation = new FreightCalculationNew();
    }

    public static CalculationController getInstance() {
        return SingletonHolder.instance;
    }

    private static class SingletonHolder {
        private static final CalculationController instance = new CalculationController();
    }

    //亏吨扣除
    public String getDeductPrice(OrderInfo orderInfo) {
        return iFreightCalculation.getDeductPrice(orderInfo);
    }

    //合理损耗
    public String getReasonableWeight(OrderInfo orderInfo) {
        return iFreightCalculation.getReasonableWeight(orderInfo);
    }

    //服务费用
    public String getServicePrice(OrderInfo orderInfo, String grants, String otherPrice) {
        return iFreightCalculation.getServicePrice(orderInfo, grants, otherPrice);
    }

    //亏吨
    public String getLoseWeight(OrderInfo orderInfo) {
        return iFreightCalculation.getLoseWeight(orderInfo);
    }

    //其他费用
    public String getDriverOtherPrice(OrderInfo orderInfo) {
        return iFreightCalculation.getDriverOtherPrice(orderInfo);
    }

    //司机费用
    public String getDriverPrice(OrderInfo orderInfo, String goodsPrice, String price, String grants, String otherPrice, String zhuangChePrice, String cangChuPrice) {
        return iFreightCalculation.getDriverPrice(orderInfo, goodsPrice, price, grants, otherPrice,  zhuangChePrice,  cangChuPrice);
    }

    //应付运费(不含税)
    public String getTotalPrice(OrderInfo orderInfo, String goodsPrice, String price, String grants, String otherPrice, String zhuangChePrice, String cangChuPrice,String mServicePrice) {
        return iFreightCalculation.getTotalPrice(orderInfo, goodsPrice, price, grants, otherPrice,  zhuangChePrice,  cangChuPrice,mServicePrice);
    }

    //应付运费(含税)
    public String getTotalTaxPrice(OrderInfo orderInfo, String goodsPrice, String price, String grants, String otherPrice, String zhuangChePrice, String cangChuPrice,String mServicePrice) {
        return iFreightCalculation.getTotalTaxPrice(orderInfo, goodsPrice, price, grants, otherPrice,  zhuangChePrice,  cangChuPrice,mServicePrice);
    }


    public void setFreightCalculation(IFreightCalculationNew iFreightCalculation) {
        this.iFreightCalculation = iFreightCalculation;
    }
}
